﻿using BCEntity.WeChatComponent.WeChatMediaRecord;
using System;
using System.Collections.Generic;
using System.Text;

namespace BCData.WeChatComponent.WeChatMediaRecord
{
    /// <summary>
    /// 微信多媒体文件上传记录数据处理接口
    /// </summary>
    public interface IWeChatMediaRecordData
    {
        /// <summary>
        /// 检查素材Id是否存在
        /// </summary>
        /// <param name="mediaId">素材Id</param>
        /// <returns></returns>
        bool CheckMediaExists(string mediaId);
        /// <summary>
        /// 添加微信多媒体文件上传记录
        /// </summary>
        /// <param name="weChatMediaRecordEntity">微信多媒体文件上传记录</param>
        bool Add(WeChatMediaRecordEntity weChatMediaRecordEntity);
        /// <summary>
        /// 添加微信多媒体文件上传记录
        /// </summary>
        /// <param name="weChatMediaRecordEntity">微信多媒体文件上传记录</param>
        bool Update(WeChatMediaRecordEntity weChatMediaRecordEntity);
        /// <summary>
        /// 获取微信多媒体文件记录
        /// </summary>
        /// <param name="mediaId">素材Id</param>
        /// <returns></returns>
        WeChatMediaRecordEntity GetEntity(string mediaId);
        /// <summary>
        /// 获取微信多媒体文件上传记录
        /// </summary>
        /// <param name="mediaId">素材Id</param>
        /// <param name="fileName">文件名称</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="fileType">文件类型</param>
        /// <param name="isTemporary">临时素材</param>
        /// <param name="ascending">排序</param>
        /// <param name="dataCount">数据总数</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <returns></returns>
        IEnumerable<WeChatMediaRecordEntity> GetRecords(string mediaId,string fileName,DateTime? start,DateTime? end,string fileType, bool? isTemporary, bool? ascending, out int dataCount,int pageIndex=1,int pageSize=10);
        /// <summary>
        /// 删除微信媒体文件上传记录
        /// </summary>
        /// <param name="mediaId">微信媒体文件Id</param>
        void Delete(string mediaId);
        
        /// <summary>
        /// 获取微信各个媒体文件上传记录总数
        /// </summary>
        /// <returns></returns>
        WeChatMediaRecordCountEntity Count();
        /// <summary>
        /// 获取临时文件记录
        /// </summary>
        /// <returns></returns>
        IEnumerable<WeChatMediaRecordEntity> GetTemporaryFileRecords();
        /// <summary>
        /// 更新素材类型为缩略图
        /// </summary>
        /// <param name="mediaId">素材Id</param>
        /// <param name="localurl">本地文件url</param>
        /// <returns></returns>
        bool UpdateMediaTypeForThumb(string mediaId,string localurl);
    }
}
